package com.hsh.maoduo.controller;

import com.hsh.maoduo.common.Result;
import com.hsh.maoduo.pojo.dto.OutboundDTO;
import com.hsh.maoduo.pojo.vo.OutboundVO;
import com.hsh.maoduo.service.OutboundService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/outbound")
public class OutboundController {


    @Resource
    private OutboundService outboundService;

    @GetMapping("/list")
    public List<OutboundDTO> getList(OutboundVO outboundVO) {
        return outboundService.getList(outboundVO);
    }

    @PostMapping("/addList")
    public Result addList(@RequestBody List<OutboundVO> outboundVOList) {
        return outboundService.addList(outboundVOList);
    }


    @PostMapping("/update")
    public Result update(OutboundVO outboundVO) {
        return outboundService.update(outboundVO);
    }

    @PostMapping("/delete")
    public Result delete(int id) {
        return outboundService.delete(id);
    }

    @PostMapping("/batchVerified")
    public Result batchVerified(@RequestBody Integer[] ids) {
        return outboundService.batchVerified(ids);
    }

    @PostMapping("/batchDelete")
    public Result batchDelete(@RequestBody Integer[] ids) {
        return outboundService.batchDelete(ids);
    }

}
